<template>
  <div class="">
    <van-nav-bar
      fixed
      title="我的礼券"
      left-arrow
      @click-left="$router.go(-1)"
      placeholder
    />
    <rollCard @click="use" btn="立即使用" :item="obj"></rollCard>
  </div>
</template>

<script>
import rollCard from "./rollCard.vue";
import { ref, reactive, toRefs } from "vue";
import { HomeRolls } from "@/api";
import { useRouter } from "vue-router";
export default {
  setup(props, { emit }) {
    let obj = ref([]);
    let token = localStorage.getItem("token");
    let router = useRouter();
    HomeRolls(token).then((res) => {
      console.log(res);
      obj.value = res;
    });
    function use() {
      router.push("/");
    }
    return { obj, use };
  },
  components: { rollCard },
};
</script>

<style lang="scss" scoped>
::v-deep .van-nav-bar .van-icon {
  color: black;
}
</style>
